package com.byxy.demo01.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import com.byxy.demo01.service.MainService;
import com.byxy.demo01.vo.TipVo;
@Controller
public class MainController {
	@Autowired
	private MainService mainService;
	
	@GetMapping("toMainPage.do")
	public String main(Model model){
		List<TipVo> tips = mainService.find();
		model.addAttribute("tips",tips);
		return"main";
	}
}
